<template>
  <a-result status="404" subtitle="测试页面">
    <template #extra>
      <a-space>
        <a-button type="primary" click="testVuex">Back</a-button>
      </a-space>
    </template>
  </a-result>
</template>

<script lang="ts">
import { defineComponent, onMounted } from "vue";
import { Message } from "@arco-design/web-vue";
import store from "@/store";
import { UserControllerService, UserLoginRequest } from "../../generated";
import { reactive } from "vue";

const form = reactive({
  userAccount: "test1",
  userPassword: "88888888",
} as UserLoginRequest);

export default defineComponent({
  name: "TestView",
  setup() {
    onMounted(async () => {
      login();
      setTimeout(() => {
        store.dispatch("user/getLoginUser");
      }, 3000);
    });
  },
});

const login = async () => {
  const res = await UserControllerService.userLoginUsingPost(form);
};
</script>

<style scoped></style>
